﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IBMS.Common;

namespace IBMS.Page
{
    public partial class AllUsersList : System.Web.UI.Page
    {
        private User user = new User();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "MyDelete")
            {
                Label idLabel = (Label)e.Item.FindControl("IDLabel");
                Label nameLabel = (Label)e.Item.FindControl("NameLabel");
                Label realNameLabel = (Label)e.Item.FindControl("RealNameLabel");
                Label passwordLabel = (Label)e.Item.FindControl("PasswordLabel");
                Label userTypeLabel = (Label)e.Item.FindControl("UserTypeLabel");
                Label projectIdLabel = (Label)e.Item.FindControl("ProjectIdLabel");
                user.Id = int.Parse(idLabel.Text.ToString());
                user.Password = passwordLabel.Text.ToString();
                user.Name = nameLabel.Text.ToString();
                user.RealName = realNameLabel.Text.ToString();
                user.UserType = userTypeLabel.Text.ToString();
                user.ProjectId = projectIdLabel.Text.ToString();
                Session["UserModification"] = user;
                Response.Redirect("UserModify.aspx");

            }
        }
    }
}